# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Transcoder.V1beta1.Model.SpriteSheet do
  @moduledoc """
  Sprite sheet configuration.

  ## Attributes

  *   `columnCount` (*type:* `integer()`, *default:* `nil`) - The maximum number of sprites per row in a sprite sheet. The default is 0, which indicates no maximum limit.
  *   `endTimeOffset` (*type:* `String.t`, *default:* `nil`) - End time in seconds, relative to the output file timeline. When `end_time_offset` is not specified, the sprites are generated until the end of the output file.
  *   `filePrefix` (*type:* `String.t`, *default:* `nil`) - Required. File name prefix for the generated sprite sheets. Each sprite sheet has an incremental 10-digit zero-padded suffix starting from 0 before the extension, such as `"sprite_sheet0000000123.jpeg"`.
  *   `format` (*type:* `String.t`, *default:* `nil`) - Format type. The default is `"jpeg"`. Supported formats: - 'jpeg'
  *   `interval` (*type:* `String.t`, *default:* `nil`) - Starting from `0s`, create sprites at regular intervals. Specify the interval value in seconds.
  *   `quality` (*type:* `integer()`, *default:* `nil`) - The quality of the generated sprite sheet. Enter a value between 1 and 100, where 1 is the lowest quality and 100 is the highest quality. The default is 100. A high quality value corresponds to a low image data compression ratio.
  *   `rowCount` (*type:* `integer()`, *default:* `nil`) - The maximum number of rows per sprite sheet. When the sprite sheet is full, a new sprite sheet is created. The default is 0, which indicates no maximum limit.
  *   `spriteHeightPixels` (*type:* `integer()`, *default:* `nil`) - Required. The height of sprite in pixels. Must be an even integer. To preserve the source aspect ratio, set the SpriteSheet.sprite_height_pixels field or the SpriteSheet.sprite_width_pixels field, but not both (the API will automatically calculate the missing field).
  *   `spriteWidthPixels` (*type:* `integer()`, *default:* `nil`) - Required. The width of sprite in pixels. Must be an even integer. To preserve the source aspect ratio, set the SpriteSheet.sprite_width_pixels field or the SpriteSheet.sprite_height_pixels field, but not both (the API will automatically calculate the missing field).
  *   `startTimeOffset` (*type:* `String.t`, *default:* `nil`) - Start time in seconds, relative to the output file timeline. Determines the first sprite to pick. The default is `0s`.
  *   `totalCount` (*type:* `integer()`, *default:* `nil`) - Total number of sprites. Create the specified number of sprites distributed evenly across the timeline of the output media. The default is 100.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :columnCount => integer() | nil,
          :endTimeOffset => String.t() | nil,
          :filePrefix => String.t() | nil,
          :format => String.t() | nil,
          :interval => String.t() | nil,
          :quality => integer() | nil,
          :rowCount => integer() | nil,
          :spriteHeightPixels => integer() | nil,
          :spriteWidthPixels => integer() | nil,
          :startTimeOffset => String.t() | nil,
          :totalCount => integer() | nil
        }

  field(:columnCount)
  field(:endTimeOffset)
  field(:filePrefix)
  field(:format)
  field(:interval)
  field(:quality)
  field(:rowCount)
  field(:spriteHeightPixels)
  field(:spriteWidthPixels)
  field(:startTimeOffset)
  field(:totalCount)
end

defimpl Poison.Decoder, for: GoogleApi.Transcoder.V1beta1.Model.SpriteSheet do
  def decode(value, options) do
    GoogleApi.Transcoder.V1beta1.Model.SpriteSheet.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Transcoder.V1beta1.Model.SpriteSheet do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
